<?php
namespace app\home\controller;
use think\Controller;
use think\View;
use think\Db;
use think\Url;
use think\Request;
use app\admin\models\Goods;
use app\admin\models\Brand;
class Product extends Controller
{
    public function Product()
    {	
    	$goods_id=input('param.goods_id');
    	$this->assign('goods_id',$goods_id);
    	if($goods_id){
    		//$goods=new Goods;
    	$goods=Goods::get($goods_id);
    	$brand = $goods->brand;
    	//print_r($brand);exit;

    	$god=Goods::where(['brand'=>$brand])->select()->toArray();
    	//print_r($god);exit;
    	$this->assign('god',$god);
    	}else{
    		$gd=Goods::all()->toArray();
    		$this->assign('gd',$gd);
    	}   	
    	
    	$bd=Brand::all()->toArray();
    		$this->assign('bd',$bd);
	 return $this->fetch('Product');
	
	}
	
	
}
?>